import request from '@/utils/request';

// 获取用户的收货地址
export function getShippingAddresses(userId) {
  return request({
    url: `/api/shipping-addresses/${userId}`,
    method: 'get',
  });
}

// 添加收货地址
export function addShippingAddress(data) {
  return request({
    url: '/api/shipping-addresses',
    method: 'post',
    data,
  });
}

// 更新收货地址
export function updateShippingAddress(id, data) {
  return request({
    url: `/api/shipping-addresses/${id}`,
    method: 'put',
    data,
  });
}

// 删除收货地址
export function deleteShippingAddress(id) {
  return request({
    url: `/api/shipping-addresses/${id}`,
    method: 'delete',
  });
}

// 根据ID获取收货地址
export function getShippingAddressById(id) {
  return request({
    url: `/api/shipping-addresses/address/${id}`,
    method: 'get',
  });
} 